package com.gelpag.base.business.menu;

import been.UserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface MenuMapper {

    //获取不需要验证权限的url
    List<String> getNoCheckUrl();

    //获取当前角色对应的所有父级菜单
    List<MenuInfo> getMenuListByRoles(@Param("user_id") String user_id, @Param("sys_code") String sys_code);

    //获取父级菜单下的所有子菜单
    List<MenuInfo> getMenuChildListByParentMenuId(@Param("menu_id") String menu_id, @Param("sys_code") String sys_code);

    List<MenuInfo> getMenuList(@Param("sys_code")String sys_code);

    List<MenuInfo> getMenuListByParentMenuId(@Param("menu_id") String menu_id, @Param("sys_code") String sys_code);

    int getResourceCountByParent_menu_id(String parent_id);

    void insertMenu(MenuInfo menuInfo);

    void updateMenu(MenuInfo menuInfo);

    MenuInfo getMenuInfoById(String menu_id);

    List<MenuInfo> getChildMenus(String menu_id);

    void delMenu(String menu_id);

    List<ResourceInfo> getUrlsByMenuId(String menu_id);

    int getChildMenusByMenuId(String menu_id);

    void insertResourceInfo(ResourceInfo resourceInfo);

    void updateResurceInfo(ResourceInfo resourceInfo);

    void delResourceRole(String resource_id);

    void delUrl(String resource_id);
}
